
<template>
  <!-- 选择项目页面 -->
  <div class="select-item">
    <div class="top">
      <div class="info">
        <div class="tabs-title">
          <span style="margin-left: 20px; color: #2e61d7; font-weight: bold"
            >数据</span
          >
        </div>
      </div>
      <div class="ipt-box">
         <input type="text" class="ipt" placeholder="请输入项目编号">
         <span>
           <img src="@/assets/search.png">
         </span>
      </div>
    </div>
    <div class="table">
        <el-table
            :data="tableData"
            style="width: 100%; margin-bottom: 20px"
            row-key="id"
            border
            default-expand-all
            :tree-props="{
              children: 'children',
              hasChildren: 'hasChildren',
            }"
          >
            <el-table-column prop="a" label="细目编号" width="200px"> </el-table-column>
            <el-table-column prop="b" label="细目名称" width="565px"> </el-table-column>

          </el-table>
    </div>
    <div class="footer">
       <div class="left"></div>
      <div class="right">
        双击选择或取消数据
        <el-button type="mini">确定</el-button>
        <el-button type="mini" class="colse-btn">取消</el-button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
    components: {},
    data () {
        return {
            tableData: [
                {
                    id: '1',
                    a: 'SDA1',
                    b: '直营经理部',

                    children: [
                        {
                            id: '1-1',
                            a: 'SDA11  ',
                            b: '  四川川交路桥有限公司',

                            children: [
                                {
                                    id: '1-1-1',
                                    a: 'SDA111',
                                    b: '四川公路桥梁集团建设有限公司',

                                },

                            ],

                        },
                    ],
                },
                {
                    id: '2',
                    a: 'SDA1',
                    b: '直营经理部',

                    children: [
                        {
                            id: '1-1',
                            a: 'SDA11  ',
                            b: '  四川川交路桥有限公司',

                            children: [
                                {
                                    id: '1-1-1',
                                    a: 'SDA111',
                                    b: '四川公路桥梁集团建设有限公司',

                                },

                            ],

                        },
                    ],
                },

            ],
        }
    },
    methods: {
        handleNodeClick () {

        }
    },
}
</script>
<style lang="scss" scoped>
.select-item {
  width: 60%;
  height: 90%;

  margin: auto;

  display: flex;
  flex-direction: column;
  .top {
    height: 50px;
    display: flex;
    justify-content: space-between;
    .info {
      width: 60px;
      height: 50px;
      line-height: 50px;
      position: relative;
      .tabs-title::before {
        content: "";
        height: 22px;
        width: 8px;
        border-radius: 40px;
        background-color: #2e61d7;
        display: block;
        position: absolute;
        left: 0px;
        top: 14px;
      }
    }
    .ipt-box {
      width: 210px;
      height: 50px;
      position: relative;
        .ipt{
            border: 0;
            width: 200px;
            height: 30px;
            border-radius: 5px;
            margin-top: 12px;
            box-sizing: border-box;
            padding-left: 20px;
            border: 1px solid #ccc;
        }
        img{
          height: 15px;
          width: 15px;
          position: absolute;
          top: 20px;
          right: 19px;
          cursor: pointer;
        }
        ::placeholder{
          padding-left: 15px;
          font-weight: 700;
        }
    }
  }
  .table {
    flex: 1;
    border-radius: 5px;
    margin-top: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
::v-deep.has-gutter th {
            background: #e0e7f9 !important;
            color: #000;
          }
          ::v-deep.el-table--enable-row-hover .el-table__body tr:hover {
            font-weight: bold;
          }
          ::v-deep.el-table ::v-deep .el-table__expand-icon--expanded {
            transform: none;
          }
          ::v-deep.el-tree ::v-deep .el-tree-node__expand-icon.expanded {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
          }
  }
  .footer {
    height: 50px;
    display: flex;
     background-color: #eff2f6;
      .left {
      width: 60%;
      height: 50px;
    }
    .right {
      line-height: 50px;
      font-weight: 500;
      color: rgb(233, 84, 66);
      font-size: 14px;
      .colse-btn {
        background-color: #fff;
        color: #000;
      }
    }
    ::v-deep.el-button--mini {
      width: 60px;
      color: #fff;
      margin-left: 10px;
      background-color: rgb(46, 97, 215);
    }
  }
}
</style>

